1. Field of the Invention
The present invention relates to a hot swap method, and particularly to a hot swap method for a switch.
2. Description of the Related Art
Management and maintenance of a network system usually need to replace or upgrade many failed devices such as modules, adapter cards, and hard disk drives to provide reliable transmission of data and extension of more functions. When the network system is shut down to replace or upgrade devices, the network system is disconnected for a long time and the transmission efficiency of the network is reduced. After devices are installed or reconnected, the network system can be reboot. Thus, hot swap design is very important in a switch. Hot swapping is a useful function for inserting hard disk drives, adapter cards, and others into a system, and removing a device from the system when the system is powered up. Hot swapping saves time for shutdown and rebooting. It is very useful in managing and maintaining a network system. There are many logic circuits and interface cards electrically connected together in a typical network system. Were it not for hot swapping, it would take much time to save the status data of the network system in order to shut down the network system. Similarly, it also takes much time to assert the initial value of the network system. For example, when a switch is shut down to replace a switch module, the network is disconnected for a long time and the transmission efficiency of the network is reduced. Thus, hot swap design is very important in a switch.
There are many methods for realizing hot swap network systems in prior art. For example, A hot-swap adapter card is disclosed in U.S. Pat. No. 5,579,491. FIG. 1 illustrates a conventional hot swap computer system. Computer system 50 includes a SCSI drive 52 contained within a mechanical drive carrier 54. The SCSI drive 52 is connectable to a SCSI bus 56, located on SCSI backplane 58, via special complementary connector (not shown) mounted on carrier 54 and device bay 60. The SCSI bus 56 is further connected to the server 51 via a backplane controller 62 and a SCSI controller 64.
When a user wants to install the SCSI drive 52 onto the SCSI bus 56 while the SCSI bus 56 is active, the user first connects the drive carrier 54 to the device bay 60 on the backplane 58 to physically connect the SCSI drive 52 to the SCSI bus 56 and then depress the button 66 on the front panel of the drive carrier 54. Depression of the button 66 generates a hot install request, in the form of an interrupt signal, to the SCSI controller 64. Responsive to receipt of the hot install request, under the control of control logic 70, the SCSI controller 64 generates an acknowledge signal to the drive carrier 54, causing the LED 68 to flash on and off. FIG. 2 is a flowchart of control logic implemented by the SCSI controller 64 for performing hot installation. In step 200, the SCSI controller 64 awaits receipt of an interrupt form from the drive carrier 54. As previously discussed, such an interrupt is generated when the button 66 is depressed to initiate a hot install/remove request. In step 204, in which a determination is made whether the interrupt is a hot install request. If the interrupt is not a hot install request, i.e., it is a hot removal request, execution proceeds to hot removal steps (not shown). Otherwise, execution proceeds to step 206, in which a signal is generated to the drive carrier 54 to cause the LED 68 to flash on and off to acknowledge receipt of the hot install request. In step 208, a determination is made whether the computer system 50 can accept an additional drive at the present time. If not, execution proceeds to step 210, in which the SCSI controller 64 turns the LED 68 off and the device bay 60 remains cold, and the system then returns to step 200 to await additional interrupts. If the system 50 is performing routine maintenance or diagnostic procedure, for example, it may be prevented from being able to accept an additional drive.
If in step 208 it is determined that the system is capable of accepting an additional drive, execution proceeds to step 212, in which the SCSI drive is electrically connected to the SCSI bus 56. In step 214, a determination is made whether the SCSI drive 52 passes inquiry by the SCSI controller 64. Such inquiry typically includes at least a determination by the SCSI controller 64 as to the physical parameters of the SCSI drive 52. If in step 214 it is determined that the SCSI drive 52 does not pass inquiry, execution proceeds to step 216, in which the SCSI drive 52 is electrically disconnected from the bus, and then to step 210, in which the LED 28 is turned off, indicating that the device bay 60 is cold. Finally, execution returns to step 200. If in step 214 it is determined that the SCSI drive 52 does pass inquiry, execution proceeds to step 218, in which the SCSI controller 64 waits for the SCSI drive 52 to spin up and then to step 220, in which a determination is made whether the SCSI drive 52 can be initialized. If in step 220 it is determined that the SCSI drive 52 can be initialized, execution proceeds to step 222, in which the SCSI controller 64 changes the LED 68 from a flashing state to a continuous on state, indicating that the device bay 60 is hot, and the SCSI driver 52 is installed on the active SCSI bus 56. Execution then returns to step 200.
The conventional hot swap method does not disclose a scheme for a device to be inserted or removed from an active computer system, which includes a hierachical system. In a hierachical system, a link between a device and the hierachical system must be set up for adding a device, and a link between a device and the hierachical system must be dismissed for removal of a device. It is necessary to provide a hot swap method to add or remove a device in a hierachical computer system.